//
// Converted:   10.05.08
// Aurthor:    	Switch
// Converter: 	MadCat
//

#if defined _race_lvrace2_included
  #endinput
#endif

#define _race_lvrace2_included
#pragma library race_lvrace2
#include "race"

static racename[MAX_NAME] = "LVRace 2";
static racefrequency = 5;
static lineupdelay = 240;
static minracers = 3;
static allowedcars[MAX_RACE_VEHICLES+1];
static Float:startlineheading = 272.0;
static Float:racecheckpoints[][CoordInfo] = {
{2672.6125,985.5797,6.3584},
{2680.1172,1379.5313,7.0318},
{2605.0435,1472.8322,10.4544},
{2548.1641,1451.3032,10.2968},
{2528.8911,1287.0098,10.2969},
{2515.0671,1193.8060,10.2967},
{2227.8516,1241.7512,10.2968},
{2246.8247,1412.3350,10.3007},
{2264.8145,1532.9839,10.2968},
{2260.0530,1533.0015,10.2991},
{2327.4248,1549.9917,10.2968},
{2341.7393,1612.9847,10.2969},
{2546.9839,1625.5905,10.2969},
{2506.9165,1741.3983,10.2959},
{2526.2810,2078.9180,10.2968},
{2511.9631,2135.4175,10.2967},
{2350.4355,1998.8438,10.2352},
{2293.0757,1894.1865,10.2968},
{2146.3867,1863.9653,10.3037},
{1981.5674,1712.7384,10.2960},
{1567.6030,1733.9701,10.2968},
{1471.7648,1872.7172,10.2978},
{1249.8389,1813.4238,12.2259},
{1007.4941,1789.1084,10.2966},
{1008.0173,1263.4282,10.2958},
{1170.4558,1176.4430,10.3949},
{1207.7604,1075.0952,6.4374},
{1514.8815,851.9245,6.4366},
{1973.7041,850.5347,6.3517}
};

static RaceID; // this will hold the id this race is assigned at init

forward race_lvrace2_init();

public race_lvrace2_init() // unique named init function (must be ran on gamemode init)
{
	RaceID = RegisterRace(racename);
	if (RaceID == INVALID_RACE_ID) return;

	Race[RaceID][race_frequency] = racefrequency;
 	Race[RaceID][race_lineupdelay] = lineupdelay;
 	Race[RaceID][race_minracers] = minracers;

	Race[RaceID][race_startheading] = startlineheading;
	set(Race[RaceID][race_vehicles],allowedcars);

	RaceSize[RaceID] = sizeof(racecheckpoints);
	for (new cpid=0;cpid<sizeof(racecheckpoints);cpid++)
	{
		RaceCheckpoints[RaceID][cpid][Coord_X] = racecheckpoints[cpid][Coord_X];
		RaceCheckpoints[RaceID][cpid][Coord_Y] = racecheckpoints[cpid][Coord_Y];
		RaceCheckpoints[RaceID][cpid][Coord_Z] = racecheckpoints[cpid][Coord_Z];
	}

	RaceStats[RaceID][race_timer] = MakeRaceSleepTime(RaceID);
	Race[RaceID][race_cashprize] = CalculateRewardMoney(RaceID); 
	Race[RaceID][race_cashentry] = CalculateEntryFee(RaceID); 
	Race[RaceID][race_xpprize] = CalculateRewardXP(RaceID); 
	Race[RaceID][race_maxracetime] = CalculateMaxRaceTime(RaceID);
    RaceStats[RaceID][race_state] = RACE_STATE_SLEEPING;
}

